﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleApp.Dapper;
using WebApp.Repositories;

namespace WebApp.Services
{
    public interface ICategoryService
    {
        IList<Day> GetCategories(int pageIndex, int pageSize);

        void Insert(Day day);
    }

    public class CategoryService : ICategoryService
    {
        private ICategoryRepository _repository = null;

        public CategoryService(ICategoryRepository repository)
        {
            _repository = repository;
        }

        public IList<Day> GetCategories(int pageIndex, int pageSize)
        {
            return _repository.GetDays().ToList();
        }

        public void Insert(Day day)
        {
            _repository.Insert(day);
        }
    }
}